package com.example.demo.common.msg.vo;

import com.example.demo.common.exception.EbsException;

/**
 * ${Description}
 *
 * @author: fuqiangnian
 * created: 17/9/7 下午2:14
 */
public enum MessageType {
    SITE("0"),              //站内消息
    SMS("1"),               //短信
    EMAIL("2"),             //邮件
    TODO("3");              //代办


    private String value;
    MessageType(String value){
        this.value = value;
    }
    public String getValue(){
        return this.value;
    }

    public static MessageType instanceOf(String value){
        switch (Integer.valueOf(value)) {
            case 0:
                return SITE;
            case 1:
                return SMS;
            case 2:
                return EMAIL;
            case 3:
                return TODO;
        }
        throw new EbsException("no support type");
    }

    public String stringValue() {
        return value;
    }

}
